import { PAGINATION_ENDPOINT_REGEX } from '../constans';

const ZIP_FILE = {
  id: 123123123,
  uuid: 'fasdf-4af4-4af2-bfee-1231',
  fileId: '646f07ace765280007f5b05b',
  name: 'ONzgORtJ77qI28jDnr+GjwJn6xELsAEqsn3FKlKNYbHR7Z129AD/WOMkAChEKx6rm7hOER2drdmXmC296dvSXtE5y5os0XCS554YYc+dcCNuTcJ9xOPSV4nAtG2f/Vj1QDyOuKmG3e/bHhU=',
  type: 'zip',
  size: '538779711',
  bucket: 'e915b140465013a95f0698a9',
  folderId: 69499376,
  folder: null,
  folderUuid: '5ff1edec-25c2-4ffa-9bc6-ae1f1e1aefd0',
  encryptVersion: '03-aes',
  deleted: false,
  deletedAt: null,
  userId: 809613,
  modificationTime: '2023-05-25T07:01:02.000Z',
  createdAt: '2023-05-25T07:01:02.000Z',
  updatedAt: '2023-07-12T07:33:38.000Z',
  plainName: 'example-txt',
  removed: false,
  removedAt: null,
  status: 'EXISTS',
  shares: [],
  thumbnails: [],
};

const PDF_SHARED_FILE = {
  id: 123413454,
  uuid: 'asdf-4008-4b72-9193-fsrhnb',
  fileId: '649d9f93ee5e78000734aa58',
  name: 'ONzgORtJ77qI28jDnr+GjwJn6xELsAEqsn3FKlKNYbHR7Z129AD/WOMkAChEKx6rm7hOER2drdmXmC296dvSXtE5y5os0XCS554YYc+dcCNF+iR4knl80upo7Jm0ojIZYDyfubaY3bDcIRQiDrjNlgY=',
  type: 'pdf',
  size: '12482692',
  bucket: 'e915b140465013a95f0698a9',
  folderId: 69499376,
  folder: null,
  folderUuid: '5ff1edec-25c2-4ffa-9bc6-ae1f1e1aefd0',
  encryptVersion: '03-aes',
  deleted: false,
  deletedAt: null,
  userId: 809613,
  modificationTime: '2023-04-19T13:02:46.000Z',
  createdAt: '2023-06-29T15:13:24.000Z',
  updatedAt: '2023-07-17T08:17:36.000Z',
  plainName: 'ExplorersGuide123',
  removed: false,
  removedAt: null,
  status: 'EXISTS',
  shares: [
    {
      id: 236506,
      active: true,
      hashed_password: null,
      code: 'J+cWcJMZNkS2YxgRXftZriLE7hvw/Kdf556rEg4F05mi44+5j7XFt1TSwjwRzAfFiNh+Gkatgg2tl20LO3qRPYWH7o/Fx8rHnirOs1j+Fq1tzq48M81zSiTPfLct917KcGbj56RvijULDPMGT5aIhO4BA3xT7EC7TkRVxH+n7KVBfb4MpKUyvMvwWDo3/ximDhU4qO+IoIrYBGzmxT5aVQ==',
      token: '25b7c8d8f93fad976490',
      is_folder: false,
    },
  ],
  thumbnails: [],
};
const IMG_FILE = {
  id: 12312312,
  uuid: 'fasderw-e9dc-4e28-bad8-ewqr',
  fileId: '64b780df69df1400070cc011',
  name: 'ONzgORtJ77qI28jDnr+GjwJn6xELsAEqsn3FKlKNYbHR7Z129AD/WOMkAChEKx6rm7hOER2drdmXmC296dvSXtE5y5os0XCS554YYc+dcCM6jmlcwwybnNXwGQ0Ush2udiedsLyEy6rAEkF5Wu/PiQW+83FP0CeRIQs6NqQUYJ08',
  type: 'png',
  size: '448259',
  bucket: 'e915b140465013a95f0698a9',
  folderId: 69499376,
  folder: null,
  folderUuid: '5ff1edec-25c2-4ffa-9bc6-ae1f1e1aefd0',
  encryptVersion: '03-aes',
  deleted: false,
  deletedAt: null,
  userId: 809613,
  modificationTime: '2023-07-19T06:21:20.000Z',
  createdAt: '2023-07-19T06:21:20.000Z',
  updatedAt: '2023-07-19T06:21:20.000Z',
  plainName: 'Screenshot 2023-07-11 at 12.34.53',
  removed: false,
  removedAt: null,
  status: 'EXISTS',
  shares: [],
  thumbnails: [
    {
      id: 4234,
      fileId: 36456,
      type: 'png',
      size: '38152',
      bucketId: 'e915b140465013a95f0698a9',
      bucketFile: '64b780e12e515400077ee9a0',
      encryptVersion: '03-aes',
      createdAt: '2023-07-19T06:21:21.822Z',
      updatedAt: '2023-07-19T06:21:21.822Z',
      maxWidth: 300,
      maxHeight: 300,
      bucket_id: 'e915b140465013a95f0698a9',
      bucket_file: '64b780e12e515400077ee9a0',
    },
  ],
};
const VIDEO_FILE = {
  id: 45674,
  uuid: 'asdfasdf-781a-4ef7-bb1231239-asdfasd',
  fileId: '64b780b7b792a800075b9b7c',
  name: 'ONzgORtJ77qI28jDnr+GjwJn6xELsAEqsn3FKlKNYbHR7Z129AD/WOMkAChEKx6rm7hOER2drdmXmC296dvSXtE5y5os0XCS554YYc+dcCNJpw9/5Xo8WGCp9/cS8xFvUSGcoQ==',
  type: 'mp4',
  size: '64751916',
  bucket: 'e915b140465013a95f0698a9',
  folderId: 69499376,
  folder: null,
  folderUuid: '5ff1edec-25c2-4ffa-9bc6-ae1f1e1aefd0',
  encryptVersion: '03-aes',
  deleted: false,
  deletedAt: null,
  userId: 809613,
  modificationTime: '2023-07-19T06:20:40.000Z',
  createdAt: '2023-07-19T06:20:40.000Z',
  updatedAt: '2023-07-19T06:20:40.000Z',
  plainName: 'test',
  removed: false,
  removedAt: null,
  status: 'EXISTS',
  shares: [],
  thumbnails: [],
};

const AUDIO_FILE = {
  id: 999068,
  uuid: 'c3ffb55b-asdf-44a7-123-123123',
  fileId: '64ba3b15d02e6c0007e07e34',
  name: 'ONzgORtJ77qI28jDnr+GjwJn6xELsAEqsn3FKlKNYbHR7Z129AD/WOMkAChEKx6rm7hOER2drdmXmC296dvSXtE5y5os0XCS554YYc+dcCM8vbHDgZoNHGggteBoLbt9UiyKu/Se0KeCF0wnC7OY12q4',
  type: 'mp3',
  size: '214422',
  bucket: 'e915b140465013a95f0698a9',
  folderId: 69499376,
  folder: null,
  folderUuid: '5ff1edec-25c2-4ffa-9bc6-ae1f1e1aefd0',
  encryptVersion: '03-aes',
  deleted: false,
  deletedAt: null,
  userId: 809613,
  modificationTime: '2023-07-21T08:00:26.000Z',
  createdAt: '2023-07-21T08:00:26.000Z',
  updatedAt: '2023-07-21T08:00:26.000Z',
  plainName: 'when-the-q-lands_1',
  removed: false,
  removedAt: null,
  status: 'EXISTS',
  shares: [],
  thumbnails: [],
};

const FOLDER = {
  type: 'folder',
  id: 9785757,
  parentId: 123,
  name: 'ONzgORtJ77qI28jDnr+GjwJn6xELsAEqsn3FKlKNYbHR7Z129AD/WOMkAChEKx6rm7hOER2drdmXmC296dvSXtE5y5os0XCS554YYc+dcCM1IIwWnPNgBUjynq0qCCobLHGtQBtzU/GxeY3nIFcyGWc5Cw==',
  parent: null,
  bucket: null,
  userId: 809613,
  user: null,
  encryptVersion: null,
  deleted: false,
  deletedAt: null,
  createdAt: '2023-07-12T07:33:35.000Z',
  updatedAt: '2023-07-12T08:23:35.000Z',
  uuid: '5ff1edec-4444-234-9bc6-erwqrhh',
  plainName: 'NewFolder',
  shares: [
    {
      id: 97857521,
      active: true,
      hashed_password: null,
      code: 'J+cWcJMZNkS2YxgRXftZriLE7hvw/Kdf556rEg4F05mi44+5j7XFt1TSwjwRzAfFiNh+Gkatgg2tl20LO3qRPYWH7o/Fx8rHnirOs1j+Fq1tzq48M81zSiTPfLct917KcGbj56RvijULDPMGT5aIhO4BA3xT7EC7TkRVxH+n7KVBfb4MpKUyvMvwWDo3/ximDhU4qO+IoIrYBGzmxT5aVQ==',
      token: '25b7c8d8f93fad976490',
      is_folder: false,
    },
  ],
  size: 0,
  removed: false,
  removedAt: null,
};

const mockGetPaginatedFolders = () =>
  cy
    .intercept(PAGINATION_ENDPOINT_REGEX.FOLDERS, {
      statusCode: 200,
      body: {
        result: [FOLDER],
      },
    })
    .as('getPaginatedFolders');

const mockGetPaginatedFiles = () =>
  cy
    .intercept(PAGINATION_ENDPOINT_REGEX.FILES, {
      statusCode: 200,
      body: {
        result: [ZIP_FILE, PDF_SHARED_FILE, IMG_FILE, VIDEO_FILE, AUDIO_FILE],
      },
    })
    .as('getPaginatedFiles');

export { mockGetPaginatedFiles, mockGetPaginatedFolders };
